package at.fhooe.mc.master.clc.shared.domain.metrics;

/**
 * Through this array all the different metrics are defined.
 * <br>
 * Note that the order of the entries is important! The order corresponds to the 
 * actions that will be executed.<br>
 * Also note that at the moment only synchronous operations are tested. Metrics for 
 * asynchronous operations are not supported at the moment.
 * 
 * @author Daniel Karzel
 *
 */
public enum MetricKey
{
	// small chunk group 1
	SMALL_CHUNK_SAVE("(Initial) SAVE Duration for SMALL Data Entity", true),
	SMALL_CHUNK_LOAD("LOAD Duration for one SMALL Data Entity", true),
	SMALL_CHUNK_UPDATE("UPDATE Duration of SMALL Data Entity", false), // TODO: activate this once implemented...
	SMALL_CHUNK_DELETE("DELETE Duration of SMALL Data Entity", true), 
	
	// small chunk group 2
	SMALL_CHUNK_SAVE_10("SAVE Duration for 10x SMALL Data Entity", true),
	SMALL_CHUNK_LOAD_ALL("LOAD Duration for all SMALL Data Entities", true),
	SMALL_CHUNK_LOAD_FILTERED("LOAD duration of SMALL Data Entity using FILTER", true),
	SMALL_CHUNK_DELETE_ALL("DELETE Duration for 10x SMALL Data Entity", true),
	
	// Big chunk group 1
	BIG_CHUNK_SAVE("SAVE Duration of BIG Data Entity", true),
	BIG_CHUNK_LOAD("LOAD Duration of BIG Data Entity", true),
	// Note: This was active for a while but problematic, because the list needed 200+ indexes! Extremely expensive to index a collection!
	// Thus not in use any more
	BIG_CHUNK_LOAD_FILTER_LIST("LOAD Duration of BIG Data Chunk using LIST FILTER", false),
	BIG_CHUNK_UPDATE("UPDATE Duration of BIG Data Entity", false), // TODO: activate this once implemented...
	BIG_CHUNK_DELETE("DELETE Duration of BIG Data Entity", true);
	
	private String label;
	private boolean active;
	
	private MetricKey(String label, boolean active)
	{
		this.label = label;
		this.active = active;
	}
	
	public String getLabel()
	{
		return this.label;
	}
	
	public boolean isActive()
	{
		return this.active;
	}
}
